package com.situ.mall.service.impl;

import com.situ.mall.mapper.LoginLogMapper;
import com.situ.mall.pojo.LoginLog;
import com.situ.mall.service.ILoginLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class LoginLogServiceImpl implements ILoginLogService {
    @Autowired
    private LoginLogMapper loginLogMapper;

    @Override
    public boolean recordLoginLog(String name, int status, String ip, String msg) {
        LoginLog loginLog = new LoginLog();
        loginLog.setName(name);
        loginLog.setStatus((byte)status);
        loginLog.setIp(ip);
        loginLog.setMsg(msg);
        return loginLogMapper.insertSelective(loginLog) > 0;
    }
}
